Focus
TheFocus
method focuses this storage unit on the specified focus context.
ODStorageUnit Focus (in ODPropertyName propertyName, in ODPositionCode propertyPosCode, in ODValueType valueType, in ODValueIndex valueIndex, in ODPositionCode valuePosCode);
propertyName
- The name of the property in the desired focus context, or
kODNULL
to ignore this parameter.propertyPosCode
- The position code, relative to the current focus context, of the property in the desired focus context, or
kODPosUndefined
to ignore this parameter.valueType
- The value type of the value in the desired focus context, or
kODNULL
to ignore this parameter.valueIndex
- The value index of the value in the desired focus context, or 0 to ignore this parameter.
valuePosCode
- The position code, relative to the current focus context, of the value in the desired focus context, or
kODPosUndefined
to ignore this parameter.- return value
- A reference to this storage unit, focused on the specified focus context.
DISCUSSION
Your part calls this method; its parameters specify the desired focus context.
After this method executes successfully, this storage unit's offset is 0.
- To focus on the entire storage unit, pass
kODNULL
as the property name parameter,kODPosAll
as the property position code parameter,kODTypeAll
as the value type parameter, 0 as the value index parameter, andkODPosUndefined
as the value position code parameter.- To focus on a property, either pass its name as the property name parameter or pass
kODNULL
as the property name parameter and the appropriate code as the property position code parameter. PasskODTypeAll
as the value type parameter, 0 as the value index parameter, andkODPosUndefined
as the value position code parameter.- To focus on a value, specify the property containing the value using either the property name parameter or the property position code parameter, as described in the previous item. You can specify the value by its type, its index, or its position.
- To use type, pass the type of the desired value as the value type parameter, 0 as the value index parameter, and
kODPosUndefined
as the value position code parameter.- To use index, pass
kODNULL
as the value type parameter, the index of the desired value as the value index parameter, andkODPosUndefined
as the value position code parameter.- To use the position code, pass
kODNULL
as the value type parameter, 0 as the value index parameter, and the appropriate code as the value position code parameter.
Before calling this method, you can call the
Exists
method to check whether the specified focus context exists.EXCEPTIONS
kODErrIllegalPropertyName
- The specified property name is improperly formed or illegal.
kODErrPropertyDoesNotExist
- This storage unit does not contain the specified property.
kODErrSUValueDoesNotExist
- This storage unit does not contain the specified value.
kODErrUnsupportedPosCode
- One of the specified position codes is not supported.
kODErrValueIndexOutOfRange
- The specified property has no value at the specified index.
kODErrZeroRefCount
- This storage unit has a reference count of 0.
SEE ALSO
TheODPositionCode
type (page 915).
TheODPropertyName
type (page 904).
TheODValueIndex
type (page 904).
TheODValueType
type (page 904).
TheODStorageUnit::Exists
method (page 681).
TheODStorageUnit::FocusWithCursor
method (page 686).
Listing 2-41 on page 100 in OpenDoc Cookbook.
Listing 2-45 on page 106 in OpenDoc Cookbook.
Listing 2-46 on page 108 in OpenDoc Cookbook.
"Focusing a Storage Unit" on page 274 in OpenDoc Programmer's Guide.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help